package com.whx.authorization.request;

import com.whx.authorization.response.LoginResponse;
import org.jsoup.Connection;

/**
 * 类名：LoginRequest
 * 类路径： com.whx.authorization.request.LoginRequest
 * 创建者： whx
 * 创建时间： 10/9/18 3:25 PM
 * 项目： authorization_center
 * 描述：
 */
public class LoginRequest extends BaseRequest<LoginResponse> {

    private Long userId;

    private String session;

    public String getMethodPath() {
        return "authorization/internalLogin";
    }

    public Class<LoginResponse> getResponseClass() {
        return LoginResponse.class;
    }

    @Override
    public Connection.Method getHttpMethod() {
        return Connection.Method.POST;
    }

    protected void addParams() {
        putParam("userId", userId);
    }

    protected void addCookies() {
        putCookieParam(AUTHORIZATION_CENTER_SESSION_NAME, session);
    }

    protected void addHeaders() {
        putHeaderParam("AuthorizationType0", "internalLogin");
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getSession() {
        return session;
    }

    public void setSession(String session) {
        this.session = session;
    }
}
